﻿using System.Windows.Input;

namespace Profit.Views
{
    using System;
    using System.Windows;
    using Profit.Views.Interfaces;
    using System.Windows.Controls;
    using Core.Contracts.Interfaces;

    /// <summary>
    /// Interaction logic for FittingsView.xaml
    /// </summary>
    public partial class FittingsView : Window, IFittingsView
    {
        public FittingsView()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Show a dialog view
        /// </summary>
        /// <param name="parent"></param>
        /// <returns></returns>
        public bool? ShowDialog(IView parent)
        {
            this.Owner = parent as Window;
            this.WindowStartupLocation =
                parent == null
                    ? System.Windows.WindowStartupLocation.CenterScreen
                    : System.Windows.WindowStartupLocation.CenterOwner;

            return ShowDialog();
        }

        public MouseButtonEventHandler ListViewMouseDoubleClick
        {
            get { return null; }
            set
            {
                fittingsList.MouseDoubleClick += value;
            }
        }
    }
}
